import request from '@/utils/request'

// 创建混合云客户授权License
export function createClientAuthLicense(data) {
  return request({
    url: '/system/client-auth-license/create',
    method: 'post',
    data: data
  })
}

// 更新混合云客户授权License
export function updateClientAuthLicense(data) {
  return request({
    url: '/system/client-auth-license/update',
    method: 'post',
    data: data
  })
}

// 删除混合云客户授权License
export function deleteClientAuthLicense(id) {
  return request({
    url: '/system/client-auth-license/delete?id=' + id,
    method: 'get'
  })
}

// 获得混合云客户授权License
export function getClientAuthLicense(id) {
  return request({
    url: '/system/client-auth-license/get?id=' + id,
    method: 'get'
  })
}

// 获得混合云客户授权License分页
export function getClientAuthLicensePage(query) {
  return request({
    url: '/system/client-auth-license/page',
    method: 'get',
    params: query
  })
}

// 导出混合云客户授权License Excel
export function exportClientAuthLicenseExcel(query) {
  return request({
    url: '/system/client-auth-license/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}


// 创建或更新客户端请求机器码文件并下载
export function createOrUpdateCSRFile(query) {
  return request({
    url: '/system/client-auth-license/create-or-update-csr-file',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 查询混合云客户授权License
export function queryLicense(qery) {
  return request({
    url: '/system/client-auth-license/query-license',
    method: 'get'
  })
}


// 查询混合云客户授权License使用量，可能比较耗时，所以分开查询
export function queryLicenseConsumption(qery) {
  return request({
    url: '/system/client-auth-license/query-license-consumption',
    method: 'get'
  })
}
